// 连接mongoDB
const mongoose = require('mongoose')
const { dbPath } =  require('./base_conf');
const dbName = 'wx_read';

mongoose.connect(`${dbPath}/${dbName}`);

const db = mongoose.connection;

db.on('connected', () =>{
    console.log('db connect is success')
})

db.on('error', (error) =>{
    console.log('db error:', error)
})


module.exports = mongoose